package models

import (
	"fmt"
	"github.com/astaxie/beego/orm"
)

//直接sql 关联查询
func Test111() (maps []orm.Params) {
	o := orm.NewOrm()
	o.Raw("SELECT * FROM   entry e ,entourage ea  WHERE e.id=ea.Entry_Id AND e.id=?", 1).Values(&maps)
	fmt.Println("TestSql...................",maps)
	return maps

}

//直接sql 关联查询
func SaveImgUrl(imgUrl string) (int64) {
	o := orm.NewOrm()
	res,_ :=o.Raw("INSERT INTO img(imgUrl) VALUES(?)",imgUrl).Exec()
	count,_ := res.RowsAffected()
	return   count

}

